package haemers.reflection.tests 
{
	import nl.haemers.data.constants.ReflectionConstants;
	import nl.haemers.data.reflection.IMetadata;
	import nl.haemers.data.reflection.Metadatas;
	import org.flexunit.Assert;
	/**
	 * ...
	 * @author Jonathan
	 */
	public class MetadatasTest 
	{
		private var _metadatas:Metadatas;
		
		/** Public methods **/
		[Before]
		public function setup() : void
		{
			_metadatas = new Metadatas(_dataXML);
		}
		
		[Test]
		public function testLookUp() : void
		{
			Assert.assertTrue(_metadatas.hasMetadata(ReflectionConstants.OBJECT_ATTRIBUTE));
			Assert.assertNotNull(_metadatas.getMetadata(ReflectionConstants.OBJECT_ATTRIBUTE));
			Assert.assertTrue(_metadatas.getMetadata(ReflectionConstants.OBJECT_ATTRIBUTE) is IMetadata);
			
			Assert.assertFalse(_metadatas.hasMetadata("__go_to_definition_help"));
			Assert.assertNull(_metadatas.getMetadata("__go_to_definition_help"));
		}
		
		[After]
		public function teardown() : void
		{
			_metadatas = null;
		}
		/** Getters & Setters **/
		
		/** Protected methods **/
		
		/** Private methods **/
		private var _dataXML:XML = new XML(
			<accessor name="accessors" access="readonly" type="__AS3__.vec::Vector.&lt;haemers.reflection.data.vo::AccessorVO>" declaredBy="haemers.data.vo::EnvironmentVO">
				<metadata name="Serialize">
				  <arg key="ignore" value="true"/>
				</metadata>
				<metadata name="__go_to_definition_help">
				  <arg key="pos" value="276"/>
				</metadata>
			</accessor>
		);
	}

}